<template>
  <div class="rail-service client-service">
    <div class="service-container">
      <div class="service-header">
        <div class="title-line">
          <span class="line-red"></span>
          <span class="line-short"></span>
        </div>
        <h2 class="service-title">{{$t('contentDetails.customerService')}}</h2>
      </div>

      <div class="service-client">
        <el-row :gutter="20">
          <el-col class="service-item" :xs="24" :sm="24" :md="24" :lg="12" :xl="12" v-for="(item, index) in clientService" :key="index">
            <el-card class="client-card" :body-style="{ padding: '0px' }">
              <img
                :src="baseUrl+item.itemIcon"
                class="client-icon lazy-image"
                :alt="item.itemTitle"
                loading="lazy"
              />
              <div style="padding: 14px;" class="client-details-box">
                <span class="client-desc">{{item.title}}</span>
                <div class="bottom clearfix">
                  <p>{{item.description}}</p>
                </div>
              </div>
            </el-card>
          </el-col>
        </el-row>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    clientService: {
      type: Array,
      default: () => ({})
    },
  },
  computed: {
    baseUrl() {
      return process.env.VUE_APP_BASE_API
    }
  },
  methods: {

  }
}
</script>

<style scoped lang="scss">
.rail-service {
  padding: 80px 0;

  .service-card {
    height: 360px !important;
  }

  .el-card.is-always-shadow {
    box-shadow: 0 4px 12px rgba(254, 50, 49, 0.2) !important;
  }
}

.service-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.client-service {
  background: url('~@/assets/asl_images/transport_back.webp') no-repeat top center;
  background-size: cover;
}

.service-item {
  position: relative;
  margin-top: 60px;
}

.client-icon {
  position: absolute;
  left: 20px;
  top: -40px;
}

.client-card {
  padding: 10px 20px 10px 80px;
  height: 140px;
}

.client-desc {
  font-weight: 550;
  font-size: 18px;
}

.service-header {
  text-align: left;
  margin-bottom: 50px;

  .title-line {
    display: flex;
    align-items: center;
    margin-bottom: 20px;

    .line-red {
      width: 60px;
      height: 6px;
      background: #fe3231;
      border-radius: 3px;
    }

    .line-short {
      width: 10px;
      height: 6px;
      background: #fe3231;
      border-radius: 3px;
      margin-left: 10px;
    }
  }

  .service-title {
    font-size: 26px;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
    line-height: 1.3;
  }

  .service-subtitle {
    font-size: 16px;
    color: #666;
    line-height: 1.8;
    max-width: 960px;
  }
}

/* 媒体查询：为小屏幕设备添加移动端样式 */
@media (max-width: 768px) {
  .rail-service {
    padding: 60px 0;

    .service-card {
      height: auto !important;
    }
  }
  .client-details-box{
    margin-left: 30px;
  }
  .service-container {
    padding: 0 15px;
  }

  .service-header {
    margin-bottom: 30px;

    .service-title {
      font-size: 22px;
    }

    .service-subtitle {
      font-size: 14px;
    }
  }

  .service-item {
    margin-top: 40px;
  }

  .client-icon {
    top: -30px;
    left: 10px;
  }

  .client-card {
    padding: 10px 15px 10px 60px;
    height: 120px;
  }

  .client-desc {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .rail-service {
    padding: 40px 0;
  }

  .service-container {
    padding: 0 10px;
  }

  .service-header {
    .title-line {
      .line-red {
        width: 40px;
      }

      .line-short {
        width: 8px;
      }
    }

    .service-title {
      font-size: 20px;
      margin-bottom: 15px;
    }

    .service-subtitle {
      font-size: 12px;
      line-height: 1.6;
    }
  }

  .service-item {
    margin-top: 30px;
  }

  .client-icon {
    top: -20px;
    left: 5px;
  }

  .client-card {
    padding: 8px 10px 8px 40px;
    height: 100px;
  }

  .client-desc {
    font-size: 14px;
  }

  .bottom p {
    font-size: 12px;
  }
}
</style>
